﻿
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ThridGroup.ERP.DTO;

namespace ThridGroup.ERP.RBAC
{  
    /// <summary>
    /// 角色权限接口
    /// </summary>
    public interface IRolePermissionServices
    {


        /// <summary>
        /// 添加角色权限
        /// </summary>
        /// <param name="createRolePermissionDto"></param>
        /// <returns></returns>
        Task<int> AddRolePermission(CreateRolePermissionDto createRolePermissionDto);

        /// <summary>
        /// 显示所有角色
        /// </summary>
        /// <returns></returns>
        Task<List<RoleListDto>> QueryRole();

        /// <summary>
        /// 显示所有权限
        /// </summary>
        /// <returns></returns>
        Task<List<PermissionlistDto>> QueryPermission();

        /// <summary>
        /// 连表查询角色、权限和角色权限
        /// </summary>
        /// <returns></returns>
        Task<List<RolePermissionListDto>> QueryRolePermission();

        /// <summary>
        /// 删除角色权限
        /// </summary>
        /// <param name="id">角色权限Id</param>
        /// <returns></returns>
        Task DeleteRolePermission(int id);


        /// <summary>
        /// 获取单条角色权限（用于反填）
        /// </summary>
        /// <param name="roleId">角色Id</param>
        /// <returns></returns>
        Task<List<RolePermissionEditDto>> GetRolePermission(List<int> roleIds);

        /// <summary>
        /// 修改角色权限
        /// </summary>
        /// <param name="dto">角色权限Dto</param>
        /// <returns></returns>
        Task<int> UpdateRolePermission(CreateRolePermissionDto dto);
        /// <summary>
        /// 获取角色权限树
        /// </summary>
        /// <returns></returns>
        Task<List<RolePermissionTreeDto>>  QueryRolePermissionTree();





    }
}
